<section class="content-header">
    <h1>
        E-library Data Detail
    </h1>
    <ol class="breadcrumb">
        <li><a href="<?php echo base_url();?>admin_home"><i class="fa fa-dashboard"></i> Home</a></li>
        <li><a href="<?php echo base_url();?>admin_elibrary">Elibrary</a></li>
        <li class="active">Detail</li>
    </ol>
</section>
<!-- Main content -->
<section class="content">
    <!-- Main row -->
    <div class="row">
        <div class='col-md-12'>
            <div class='box'>
                <div class='box-header'>
                    <h3 class='box-title'>Detail Data<small> E Library</small></h3>
                    <!-- tools box -->
                    <div class="pull-right box-tools">
                        <button class="btn btn-default btn-sm" data-widget='collapse' data-toggle="tooltip" title="Collapse"><i class="fa fa-minus"></i></button>
                    </div><!-- /. tools -->
                </div><!-- /.box-header -->
                <div class='box-body pad'>
                    <?php
                    if(isset($success_status)){
                        ?>
                    <div id="msg_success" class="alert alert-success alert-dismissable">
                        <i class="fa fa-check"></i>
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">x</button>
                        <b>Congratulation!</b> Data has been updated.
                    </div>
                    <div id="msg" class="alert alert-danger alert-dismissable">
                        <i class="fa fa-ban"></i>
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">x</button>
                        <b>Alert!</b> Danger alert preview. This alert is dismissable. A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart.
                    </div>                    
                        <?php
                    }
                    else{
                        if(isset($error)){
                        ?>
                            <div id="msg" class="alert alert-danger alert-dismissable" style="display: block;">
                                <i class="fa fa-ban"></i>
                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">�</button>
                                <b>Alert!</b> <?php echo $error;?>
                            </div>
                        <?php
                        }
                        else{
                    ?>
                    <div id="msg" class="alert alert-danger alert-dismissable">
                        <i class="fa fa-ban"></i>
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">x</button>
                        <b>Alert!</b> Danger alert preview. This alert is dismissable. A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart.
                    </div>
                        <?php
                        }
                    }
                    ?>
                    <form role="form" action="" method="post" enctype="multipart/form-data" id="frm_update_elib">
                        <?php
                        foreach($list_data as $r):
                        ?>
                        <div class="form-group">
                            <label>Judul</label>
                            <input type="text" id="judul" name="judul" class="form-control" value="<?php echo $r->judul;?>" placeholder="Masukkan Judul"/>
                        </div>
                        <div class="form-group">
                            <label>Kategori</label>
                            <select id="kategori" name="kategori" class="form-control">
                                <option value=""> - Pilih Kategori - </option>
                                <option <?php if(strtolower($r->kategori) == "dasarhukum"){echo"selected";}?> value="dasarhukum">Dasar Hukum</option>
                                <option <?php if(strtolower($r->kategori) == "info"){echo"selected";}?> value="info">Info</option>
                                <option <?php if(strtolower($r->kategori) == "report"){echo"selected";}?> value="report">Report</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label>Isi Konten</label>
                            <textarea id="editor1" name="content" style="width: 100%; height: 200px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;"><?php echo $r->deskripsi;?></textarea>    
                        </div>
                        
                        <div class="form-group">
                            <a class="btn btn-primary btn-xs btn-success" href="<?php echo base_url().$r->file;?>"><i class="fa fa-download"></i> Download Berkas</a>
                        </div>
                        <div class="form-group">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" id="new_file" name="new_value" value="1"> Ganti berkas baru
                                </label>                                                
                            </div>
                        </div>
                        <div class="form-group" id="file_baru" style="display: none;">
                            <label for="userfile">Input File <small style="color: #737373;font-size: 85%;font-weight: normal;">(pilih file baru jika ingin mengganti file)</small></label>
                            <input type="file" id="userfile" name="userfile" />
                            <p class="help-block">.pdf .doc .docx .zip .rar .ppt .pptx</p>
                        </div>
                        <?php
                        endforeach;
                        ?>
                        <div class="form-group" style="border-top: 1px dotted #ddd;padding-top: 20px;">
                            <input type="submit" class="btn btn-primary" value="Update" />
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>    
</section>